#ifndef HTTPSTREAM_H
#define HTTPSTREAM_H

#include <QObject>
#include "streambase.h"
#include "http/ezqhttp.h"

class HttpStream : public StreamBase
{
    Q_OBJECT
protected:
    ~HttpStream();
public:
    explicit HttpStream(EZQHTTPNS::EZQHttp *http);

private:
    EZQHTTPNS::EZQHttp *_http;
//    void setHttp(EZQHTTPNS::EZQHttp *http);

    qint64 _reciveLen;
    QMutex _mutex;
public:

    EZQHTTPNS::EZQHttp *http() const;

    virtual qint64 validFrom(qint64 offset=0);
    virtual qint64 read(void *buffer,qint64 offset,qint64 bufferLen);

signals:

private slots:
    friend class EZQHTTPNS::EZQHttp;
    void onStatusChange(EZQHTTPNS::HttpStatus);
    void onDownloadProgress(qint64,qint64);
public slots:

};

#endif // HTTPSTREAM_H
